// special cases
T(RN,                  0x0p+0,                     inf,          0x0p+0, DIVBYZERO)
T(RN,                 -0x0p+0,                    -inf,          0x0p+0, DIVBYZERO)
T(RN,                  0x1p+0,                  0x1p+0,          0x0p+0, 0)
T(RN,                 -0x1p+0,                     nan,          0x0p+0, INVALID)
T(RN,                  0x1p+1,                  0x1p+0,          0x0p+0, 0)
T(RN,                 -0x1p+1,                     nan,          0x0p+0, INVALID)
T(RN,                     inf,                     inf,          0x0p+0, 0)
T(RN,                    -inf,                     nan,          0x0p+0, INVALID)
T(RN,                     nan,                     nan,          0x0p+0, 0)
// positive int
T(RN,                  0x1p+1,                  0x1p+0,          0x0p+0, 0)
T(RN,                  0x1p+2,                0x1.8p+2,          0x0p+0, INEXACT)
T(RN,                0x1.8p+1,                  0x1p+1,          0x0p+0, INEXACT)
T(RN,                0x1.4p+2,                0x1.8p+4,          0x0p+0, INEXACT)
T(RN,                0x1.8p+2,                0x1.ep+6,          0x0p+0, INEXACT)
T(RN,                0x1.cp+2,               0x1.68p+9,          0x0p+0, INEXACT)
T(RN,                  0x1p+3,              0x1.3bp+12,          0x0p+0, INEXACT)
T(RN,                0x1.2p+3,              0x1.3bp+15,          0x0p+0, INEXACT)
T(RN,                0x1.4p+3,             0x1.626p+18,          0x0p+0, INEXACT)
T(RN,                0x1.6p+3,            0x1.baf8p+21,          0x0p+0, INEXACT)
T(RN,                0x1.8p+3,           0x1.308a8p+25,          0x0p+0, INEXACT)
T(RN,                0x1.ap+3,           0x1.c8cfcp+28,          0x0p+0, INEXACT)
T(RN,                0x1.cp+3,          0x1.7328ccp+32,          0x0p+0, INEXACT)
T(RN,                0x1.ep+3,         0x1.44c3b28p+36,          0x0p+0, INEXACT)
T(RN,                  0x1p+4,        0x1.30777758p+40,          0x0p+0, INEXACT)
T(RN,                  0x1p+5,  0x1.956ad0aae33a4p+112,  -0x1.583174p-2, INEXACT)
T(RN,                  0x1p+6,  0x1.fe478ee34844ap+289,   0x1.82ad54p-4, INEXACT)
T(RN,                  0x1p+7,  0x1.1e5dfc140e1e5p+709,  -0x1.861c04p-3, INEXACT)
T(RN,               0x1.14p+7,  0x1.939c09fd12eebp+779,   0x1.b26568p-2, INEXACT)
T(RN,               0x1.16p+7,  0x1.b3243ac4d8695p+786,   0x1.91554ep-4, INEXACT)
T(RN,               0x1.18p+7,  0x1.d88957d1c3026p+793,   0x1.34f4a8p-2, INEXACT)
T(RN,               0x1.1ap+7,  0x1.026b1c06b6a55p+801,   0x1.88f5ccp-2, INEXACT)
T(RN,               0x1.1cp+7,  0x1.1ca9fcdf65321p+808,  -0x1.ae427ap-3, INEXACT)
T(RN,               0x1.1ep+7,  0x1.3bcc9487d4439p+815,    0x1.42ae4p-3, INEXACT)
T(RN,                0x1.2p+7,  0x1.60ce8defbf238p+822,   0x1.fc3f56p-2, INEXACT)
T(RN,               0x1.22p+7,  0x1.8ce85fadb707ep+829,  -0x1.c438bep-2, INEXACT)
T(RN,               0x1.52p+7, 0x1.7932fa79d3a43p+1004,   0x1.713c88p-4, INEXACT)
T(RN,               0x1.54p+7, 0x1.f2054eb4d96ecp+1011,  -0x1.5e1f86p-2, INEXACT)
T(RN,               0x1.56p+7, 0x1.4ab7864418639p+1019,   0x1.bbf88cp-5, INEXACT)
T(RN,               0x1.58p+7,                     inf,          0x0p+0, INEXACT|OVERFLOW)
T(RN,                  0x1p+8,                     inf,          0x0p+0, INEXACT|OVERFLOW)
// close to poles
T(RN,                 0x1p-50,   0x1.ffffffffffffbp+49,  -0x1.877304p-2, INEXACT)
T(RN,                 0x1p-51,   0x1.ffffffffffffep+50,   0x1.3c467ep-2, INEXACT)
T(RN,                 0x1p-52,   0x1.fffffffffffffp+51,   0x1.3c467ep-3, INEXACT)
T(RN,                 0x1p-53,   0x1.fffffffffffffp+52,   -0x1.b0ee6p-2, INEXACT)
T(RN,                 0x1p-54,                 0x1p+54,    0x1.2788dp-3, INEXACT)
T(RN,  0x1.000000000001p-1024,  0x1.fffffffffffep+1023,        -0x1p-43, INEXACT)
T(RN, -0x1.000000000001p-1024, -0x1.fffffffffffep+1023,         0x1p-43, INEXACT)
T(RN,                -0x1p-54,                -0x1p+54,    0x1.2788dp-3, INEXACT)
T(RN,                -0x1p-53,                -0x1p+53,    0x1.2788dp-2, INEXACT)
T(RN,                -0x1p-52,  -0x1.0000000000001p+52,   -0x1.b0ee6p-2, INEXACT)
T(RN,                -0x1p-51,  -0x1.0000000000001p+51,   0x1.3c467ep-3, INEXACT)
T(RN,                -0x1p-50,  -0x1.0000000000002p+50,   0x1.3c467ep-2, INEXACT)
T(RN,   -0x1.ffffffffffffcp-1,  -0x1.0000000000001p+51,  -0x1.3c467ep-3, INEXACT)
T(RN,   -0x1.ffffffffffffdp-1,  -0x1.5555555555556p+51,   0x1.6e642cp-3, INEXACT)
T(RN,   -0x1.ffffffffffffep-1,                -0x1p+52,    0x1.b0ee6p-2, INEXACT)
T(RN,   -0x1.fffffffffffffp-1,                -0x1p+53,    0x1.b0ee6p-3, INEXACT)
T(RN,   -0x1.0000000000001p+0,   0x1.fffffffffffffp+51,  -0x1.3c467ep-3, INEXACT)
T(RN,   -0x1.0000000000002p+0,   0x1.ffffffffffffep+50,  -0x1.3c467ep-2, INEXACT)
T(RN,   -0x1.0000000000003p+0,   0x1.5555555555554p+50,   0x1.6e642cp-2, INEXACT)
T(RN,   -0x1.0000000000004p+0,   0x1.ffffffffffffdp+49,   0x1.877304p-2, INEXACT)
T(RN,   -0x1.ffffffffffffcp+0,   0x1.0000000000004p+49,   0x1.3c467ep-2, INEXACT)
T(RN,   -0x1.ffffffffffffdp+0,   0x1.5555555555559p+49,  -0x1.90ed72p-6, INEXACT)
T(RN,   -0x1.ffffffffffffep+0,   0x1.0000000000002p+50,   0x1.3c467ep-3, INEXACT)
T(RN,   -0x1.fffffffffffffp+0,   0x1.0000000000001p+51,   0x1.3c467ep-4, INEXACT)
T(RN,   -0x1.0000000000001p+1,  -0x1.ffffffffffffcp+49,   0x1.3c467ep-2, INEXACT)
T(RN,   -0x1.0000000000002p+1,  -0x1.ffffffffffff9p+48,  -0x1.877304p-2, INEXACT)
T(RN,   -0x1.0000000000003p+1,  -0x1.555555555554ep+48,  -0x1.90ed72p-5, INEXACT)
T(RN,   -0x1.0000000000004p+1,  -0x1.ffffffffffff1p+47,   0x1.e233f2p-3, INEXACT)
T(RN,   -0x1.7fffffffffffdp+1,  -0x1.c71c71c71c72ap+46,  -0x1.4177f6p-3, INEXACT)
T(RN,   -0x1.7fffffffffffep+1,  -0x1.555555555555cp+47,   0x1.0b48f6p-5, INEXACT)
T(RN,   -0x1.7ffffffffffffp+1,  -0x1.5555555555559p+48,  -0x1.44a0c6p-2, INEXACT)
T(RN,   -0x1.5800000000001p+7, -0x1.b98c8c968b7c1p-990,   0x1.970c8ep-3, INEXACT)
T(RN,   -0x1.5800000000002p+7,  -0x1.b98c8c968b35p-991,   0x1.f3c9bcp-4, INEXACT)
T(RN,   -0x1.5800000000003p+7, -0x1.265db30f07495p-991,  -0x1.366b9cp-2, INEXACT)
T(RN,   -0x1.5800000000004p+7, -0x1.b98c8c968aa6ep-992,  -0x1.01aa08p-5, INEXACT)
T(RN,   -0x1.59ffffffffffcp+7, -0x1.46b1fa841b485p-999,  -0x1.acebdep-5, INEXACT)
T(RN,   -0x1.59ffffffffffdp+7, -0x1.b397f8b0241a4p-999,  -0x1.9c2ff4p-2, INEXACT)
T(RN,   -0x1.59ffffffffffep+7,  -0x1.46b1fa841adfp-998,   0x1.cb558ep-2, INEXACT)
T(RN,   -0x1.59fffffffffffp+7, -0x1.46b1fa841aaa6p-997,   0x1.979e28p-3, INEXACT)
T(RN,   -0x1.5a00000000001p+7,  0x1.46b1fa841a412p-997,   0x1.333de2p-2, INEXACT)
T(RN,   -0x1.5bfffffffffffp+7, 0x1.e0a7b14f99fdbp-1005,  -0x1.af416ap-2, INEXACT)
T(RN,   -0x1.5c00000000001p+7,-0x1.e0a7b14f9962ap-1005,   0x1.42ddc4p-2, INEXACT)
T(RN,   -0x1.5dfffffffffffp+7, -0x1.5f90991893bep-1012,   0x1.97c846p-2, INEXACT)
T(RN,   -0x1.5e00000000001p+7, 0x1.5f909918934c8p-1012,   0x1.731f2ep-2, INEXACT)
T(RN,   -0x1.5ffffffffffffp+7, 0x1.ff5df5f533fd3p-1020,  -0x1.f234a4p-2, INEXACT)
T(RN,   -0x1.6000000000001p+7,-0x1.ff5df5f53357ep-1020,    0x1.492c4p-6, INEXACT)
T(RN,   -0x1.61fffffffffffp+7, -0x1.71cd59a44e18p-1027,   0x1.657fa6p-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.6200000000001p+7,   0x1.71cd59a44dap-1027,  -0x1.8ce5d8p-3, INEXACT|UNDERFLOW)
T(RN,   -0x1.63fffffffffffp+7,    0x1.09ecd608d9p-1034,  -0x1.e41c8ep-3, INEXACT|UNDERFLOW)
T(RN,   -0x1.6400000000001p+7,   -0x1.09ecd608d9p-1034,  -0x1.9a7d5ep-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.65fffffffffffp+7,     -0x1.7c5148fdp-1042,   -0x1.3af1cp-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6600000000001p+7,      0x1.7c5148fdp-1042,   0x1.42a7aap-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.67fffffffffffp+7,        0x1.0e72b1p-1049,  -0x1.dc1df4p-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6800000000001p+7,       -0x1.0e72b1p-1049,   0x1.dc12fap-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.69fffffffffffp+7,         -0x1.7e83p-1057,   0x1.98a6fap-3, INEXACT|UNDERFLOW)
T(RN,   -0x1.6a00000000001p+7,          0x1.7e83p-1057,  -0x1.98a6f2p-3, INEXACT|UNDERFLOW)
T(RN,   -0x1.6bfffffffffffp+7,            0x1.0dp-1064,  -0x1.3f914ep-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6c00000000001p+7,           -0x1.0dp-1064,   0x1.3f914ep-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6dffffffffffcp+7,              -0x1p-1074,   0x1.e1554cp-2, INEXACT|UNDERFLOW)
T(RN,   -0x1.6dffffffffffdp+7,              -0x1p-1073,  -0x1.471cdap-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.6dffffffffffep+7,            -0x1.8p-1073,  -0x1.eaab46p-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.6dfffffffffffp+7,            -0x1.8p-1072,  -0x1.eaab46p-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e00000000001p+7,             0x1.8p-1072,   0x1.eaab46p-4, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e00000000002p+7,             0x1.8p-1073,   0x1.eaab46p-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e00000000003p+7,               0x1p-1073,   0x1.471cdap-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e00000000004p+7,               0x1p-1074,  -0x1.e1554cp-2, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e0000000000bp+7,               0x1p-1074,   0x1.dc9b2ap-2, INEXACT|UNDERFLOW)
T(RN,   -0x1.6e0000000000cp+7,                  0x0p+0,  -0x1.f5c71ap-2, INEXACT|UNDERFLOW)
T(RN,   -0x1.6ffffffffffffp+7,                  0x0p+0,  -0x1.05cc0ep-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.7000000000001p+7,                 -0x0p+0,   0x1.05cc0ep-5, INEXACT|UNDERFLOW)
T(RN,   -0x1.9000000000001p+7,                 -0x0p+0, 0x1.894d44p-127, INEXACT|UNDERFLOW)
T(RN,   -0x1.9200000000001p+7,                  0x0p+0,  -0x1.f4ecp-135, INEXACT|UNDERFLOW)
// (negative) half values
T(RN,                  0x1p-1,    0x1.c5bf891b4ef6bp+0,   0x1.618f14p-2, INEXACT)
T(RN,                 -0x1p-1,   -0x1.c5bf891b4ef6bp+1,  -0x1.618f14p-2, INEXACT)
T(RN,               -0x1.8p+0,    0x1.2e7fb0bcdf4f2p+1,    0x1.d7697p-3, INEXACT)
T(RN,               -0x1.4p+1,   -0x1.e3ff812e32183p-1,  -0x1.58a8b4p-3, INEXACT)
T(RN,               -0x1.cp+1,    0x1.149200acaee94p-2,   0x1.89e55ep-4, INEXACT)
T(RN,               -0x1.2p+2,   -0x1.ebae3a168c495p-5,   0x1.4c8972p-3, INEXACT)
T(RN,               -0x1.6p+2,    0x1.6595fbb34ec0fp-7,  -0x1.9031fcp-2, INEXACT)
T(RN,               -0x1.ap+2,  -0x1.b81b0e66884ffp-10,   0x1.003d84p-2, INEXACT)
T(RN,               -0x1.ep+2,   0x1.d572317e6f443p-13,  -0x1.de1f7cp-2, INEXACT)
T(RN,               -0x1.1p+3,  -0x1.b9d4e349d2221p-16,   0x1.85c348p-2, INEXACT)
T(RN,               -0x1.3p+3,   0x1.741196facbe6dp-19,   0x1.8855b4p-5, INEXACT)
T(RN,               -0x1.5p+3,  -0x1.1b7b1db2e47f1p-22,   0x1.f30408p-2, INEXACT)
T(RN,               -0x1.7p+3,   0x1.8a68825d1162fp-26,   0x1.a2c2bep-2, INEXACT)
T(RN,               -0x1.9p+3,  -0x1.f8d7b11af788ep-30,  -0x1.c617fep-2, INEXACT)
T(RN,               -0x1.bp+3,   0x1.2b2a7bea0df24p-33,  -0x1.e96d0ap-2, INEXACT)
T(RN,               -0x1.dp+3,  -0x1.4a1d3948e3405p-37,  -0x1.e1c1d6p-5, INEXACT)
T(RN,               -0x1.fp+3,   0x1.54c353e824637p-41,   0x1.6773dap-2, INEXACT)
T(RN,              -0x1.08p+4,   -0x1.4a6fd53e32cdp-45,    0x1.27d98p-3, INEXACT)
T(RN,              -0x1.04p+5, -0x1.62f4f602d0132p-119,    0x1.7415ep-3, INEXACT)
T(RN,              -0x1.02p+6, -0x1.912276590832ep-298,   0x1.59f79ap-2, INEXACT)
T(RN,              -0x1.01p+7, -0x1.fae67dea6e7fap-719,   0x1.317978p-3, INEXACT)
T(RN,              -0x1.4fp+7, 0x1.ba80f2ad58fe1p-1000,  -0x1.097458p-2, INEXACT)
T(RN,              -0x1.51p+7,-0x1.50252eda48291p-1007,   0x1.27d8c2p-2, INEXACT)
T(RN,              -0x1.53p+7, 0x1.fbb03aae1cf04p-1015,  -0x1.b282acp-3, INEXACT)
T(RN,              -0x1.55p+7,-0x1.7d2374dfcda7ap-1022,  -0x1.c68fa4p-3, INEXACT)
T(RN,              -0x1.57p+7,   0x1.1c7702e43cfp-1029,   -0x1.876cep-3, INEXACT|UNDERFLOW)
T(RN,              -0x1.59p+7,    -0x1.a6299204dp-1037,  -0x1.ccc1c8p-3, INEXACT|UNDERFLOW)
T(RN,              -0x1.5bp+7,      0x1.37738298p-1044,  -0x1.2471f8p-3, INEXACT|UNDERFLOW)
T(RN,              -0x1.5dp+7,       -0x1.c8ea04p-1052,  -0x1.a89b2ep-2, INEXACT|UNDERFLOW)
T(RN,              -0x1.5fp+7,           0x1.4d4p-1059,   0x1.14a72cp-2, INEXACT|UNDERFLOW)
T(RN,              -0x1.61p+7,           -0x1.e4p-1067,  -0x1.4c43aap-2, INEXACT|UNDERFLOW)
T(RN,              -0x1.63p+7,               0x1p-1074,   -0x1.723acp-2, INEXACT|UNDERFLOW)
T(RN,              -0x1.65p+7,                 -0x0p+0,   0x1.f3e44ep-8, INEXACT|UNDERFLOW)
T(RN,             -0x1.008p+8,                 -0x0p+0,          0x0p+0, INEXACT|UNDERFLOW)
// various tests
T(RN,   -0x1.facae9c9e7105p+5,  0x1.a98422d742f9fp-291,   0x1.dc5df6p-2, INEXACT)
T(RN,   -0x1.fdce012aee935p+6,  0x1.46480e4894aafp-711,  -0x1.0c602ap-2, INEXACT)
T(RN,    0x1.1a781948507bcp+7,  0x1.9c3e83141654dp+802,   0x1.09f0d4p-3, INEXACT)
T(RN,   -0x1.1a781948507bcp+7,  0x1.50c668ed04665p-808,  -0x1.dfe3c6p-3, INEXACT)
T(RN,               0x1.57p+7, 0x1.0e1863dcad789p+1023,  -0x1.4a306cp-3, INEXACT)
T(RN,    0x1.573fae561f646p+7, 0x1.ffffffffff92cp+1023,  -0x1.d9f23ep-2, INEXACT)
T(RN,    0x1.573fae561f647p+7, 0x1.ffffffffffe51p+1023,   0x1.5b4ff6p-4, INEXACT)
T(RN,    0x1.573fae561f648p+7,                     inf,          0x0p+0, INEXACT|OVERFLOW)
T(RN,    0x1.edd3c07ee0b0bp+6,  0x1.6acf6a2fdfaefp+677,   0x1.4cab56p-2, INEXACT)
T(RN,   -0x1.edd3c07ee0b0bp+6,   0x1.28e9bf97c82ep-683,  -0x1.064766p-2, INEXACT)
T(RN,    0x1.8b0fcd324d5a2p+3,   0x1.64165e040d97cp+26,   0x1.faf78cp-2, INEXACT)
T(RN,   -0x1.8b0fcd324d5a2p+3,  -0x1.a77825d8a2292p-29,  -0x1.4c75e2p-2, INEXACT)
